<?php
error_reporting(E_ERROR | E_PARSE | E_WARNING);

 include("db.class.php");
 $conf=include("db.conf.php");
//print_r($conf);
use PFT\Db;

$id=$_POST['accountid'];
$name=$_POST['accountname'];
$adstatus=$_POST['adstatus'];
$forbiden=$_POST['forbiden'];
$max_debt=$_POST['max_debt'];
$delay_days=$_POST['delay_days'];
$proof_price=$_POST['proof_price'];
$package_order_num=$_POST['package_order_num'];
$package_startdate=$_POST['package_startdate'];
$package_enddate=$_POST['package_enddate'];

if(preg_match('/^\d+$/i', $id)==0)
{echo"<script> alert('id数据格式错误!');window.location='zadminpz.html'</script>";}

elseif($name==null)
{echo"<script> alert('用户名不能为空!');window.location='zadminpz.html'</script>";}

if(preg_match('/^\d+$/i', $max_debt)==0)
{echo"<script> alert('金额数据格式错误!');window.location='zadminpz.html'</script>";}

if(preg_match('/^\d+$/i', $delay_days)==0)
{echo"<script> alert('时长数据格式错误!');window.location='zadminpz.html'</script>";}

if(preg_match('/^\d+$/i', $proof_price)==0)
{echo"<script> alert('凭证费数据格式错误!');window.location='zadminpz.html'</script>";}
$pricing_package=$_POST['pricing_package'];
if(preg_match('/^\d+$/i', $pricing_package)==0)
{echo"<script> alert('套餐标准数据格式错误!');window.location='zadminpz.html'</script>";}

if(preg_match('/^\d+$/i', $package_order_num)==0)
{echo"<script> alert('凭证数数据格式错误!');window.location='zadminpz.html'</script>";}

Db :: Conf($conf['localhost']);

$con=Db::Connect()or die("死了1");
// $dbme='mysql';
// $dbname='test';
// $user='root';
// $pass='';
// $host='localhost';
// $dsn="$dbme:host=$host;dbname=$dbname";

// $pdo=new PDO($dsn,$user,$pass);
// print_r($pdo);
// echo "chenggong";


 $str="insert into ftp_account_set('id','name','adstatus','forbiden_reason','max_debt','arrears_days',
'proof_price','packge_order_num','pricing_packge','packge_startdate','packge_enddate')
 values($id,$name,$adstatus,$forbiden,$max_debt,$delay_days,$proof_price,$pricing_package,$package_order_num,
 $package_startdate,$package_enddate)";

// $stmt=$con->prepare($str);
echo $str;
$con->exec($str)or die("死了2");

//Db::execute($str)or die("死了2");
// $stmt->execute();
// $row=$stmt->fetch(PDO::FETCH_ASSOC);
// print_r($row);






?>